<%@ page language="java" contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>

<!DOCTYPE html>
<html>
<head>
<%@ include file="/common/links.jsp"%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript">
	$(document).ready(function() {
		$('#submit').click(function() {
			try{
			var subResult = $('#demoTreeNodeForm').ajaxSubmit(formOptions);
			return false;
			}catch(e){
				alert(e.message);
			}
		})
		$('#cancel').click(function() {
			closePopUpForm();
		})
		$("button").button();
		//$( "#demoEntity_dateField" ).datepicker(datePickerOptions);//TODO here init date field datepicker bind
		 jQuery("#demoTreeNodeForm").validationEngine({promptPosition : "centerRight"});
	});

</script>
</head>
<body>
	<fieldset>
		<legend>
			<c:if test="${editType==1}">
				<s:text name="demoTreeNodeNew.title" />
			</c:if>
			<c:if test="${editType==2}">
				<s:text name="demoTreeNodeEdit.title" />
			</c:if>
		</legend>
		<s:form id="demoTreeNodeForm" action="saveDemoTreeNode" theme="xhtml" validate="false">
			<s:hidden name="gridId"/>
			<s:hidden name="editType"/>
			<s:hidden key="model.nodeId"/>
			<s:textfield id="demoTreeNode_nodeName" key="demoTreeNode.nodeName" name="model.nodeName" required="true" cssClass="validate[required]"/>
    <!-- todo: change this to read the identifier field from the other pojo -->
    <%-- <s:select name="demoTreeNode.parentNode.id" list="parentNodeList" listKey="id" listValue="id"></s:select> --%>
		</s:form>
		<button name="submit" type="button" id="submit">
			<s:text name="button.save" />
		</button>
		<button name="cancel" type="button" id="cancel">
			<s:text name="button.cancel" />
		</button>
	</fieldset>
</body>
</html>





















